package all.util;

import all.bean.RequestMehod;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.griftt.rent.data.common.bean.RequestData;

/**
 * @auther: Griftt wu
 * @date: 2019/9/26
 **/
public class RequestDataHandler {


    public static RequestMehod handleToGetRequestmethod(RequestData requestData){
        RequestMehod requestMehod = new RequestMehod();
        requestMehod.setActionName(requestData.getActionName());
        requestMehod.setMethodName(requestData.getMethodName());
        return requestMehod;
    }
    public static Object handleRequest(RequestData requestData){
        //這裡做參數的校驗

        //token的驗證
        RequestMehod requestMehod = handleToGetRequestmethod(requestData);
        return  DubboServiceFactory.getInstance().genericInvoke(requestMehod.getActionName(),requestMehod.getMethodName(),"com.griftt.rent.data.common.bean.RequestData",requestData);
    }


}
